package com.pubsys.main.server.database.fetchers;

import java.sql.ResultSet;
import java.sql.SQLException;

import com.pubsys.main.server.database.AbstractDataFetcher;
import com.pubsys.main.shared.model.ParteMonografia;
import com.pubsys.main.shared.model.Referencia;

public class ReferenciaFetcher extends AbstractDataFetcher<Referencia> {

	public ReferenciaFetcher(String whereString) {
		super("select * from referencias " + whereString);
	}

	@Override
	public void fetchDataFromResultSet(ResultSet resultSet) throws SQLException {		
		while (resultSet.next()){
			Referencia ref = new ParteMonografia();
			ref.setTitulo(resultSet.getString("titulo"));
			ref.setLocal(resultSet.getString("local"));
			this.results.add(ref);
		}
	}

}
